package cn.play.cardgame.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class SharePreferenceUtil {

	private SharePreferenceUtil() {
	}

	public static final String LAST_WIN_NAME = "last_win";

	public static float getLastWin(Context context) {
		SharedPreferences sharedPreferences = PreferenceManager
				.getDefaultSharedPreferences(context);
		return sharedPreferences.getFloat(LAST_WIN_NAME, 0);
	}

	public static void putLastWin(Context context, float lastwin) {
		SharedPreferences sharedPreferences = PreferenceManager
				.getDefaultSharedPreferences(context);
		SharedPreferences.Editor editor = sharedPreferences.edit();
		editor.putFloat(LAST_WIN_NAME, lastwin);
		editor.commit();
	}
}
